import { getAbout } from "@/api/about";

export default {
	namespaced: true,
	state: {
		loading: false,
		url: "",
	},
	mutations: {
		setLoading(state, payout) {
			state.loading = payout;
		},
		setUrl(state, payout) {
			state.url = payout;
		},
	},
	actions: {
		async fetchGetAbout(ctx) {
			if (ctx.state.url) {
				return;
			}
			ctx.commit("setLoading", true);
			const resp = await getAbout();
			ctx.commit("setUrl", resp);
			ctx.commit("setLoading", false);
		},
	},
};
